<template>
    <el-drawer
        size="40%"
        title="评论"
        :visible.sync="childrawer"
        :direction="direction"
        :before-close="handleClose">
        <span>我来啦!</span>
    </el-drawer>

</template>
<script>
export default {
  name:"addComment",
  props:['drawer'],
  data() {
      return {
        direction: 'rtl',
      };
    },
  methods:{
    handleClose(done) {
        this.$confirm('确认关闭？')
          .then(_ => {
            done();
            this.childrawer = false
          })
          .catch(_ => {});
      }
  },
  computed:{
    childrawer:{
        get() {
            return this.drawer
        },
        set(val) {
            this.$emit("CommentSwitchShow",val)
        },
        
    }
  }
}
</script>
<style scoped>
.mask{
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 2;
    background-color: rgba(0,0,0,.5);
}
.commentList{
    background-color:#fff;
    position: fixed;
    width: 500px;
    height: 100vh;
    z-index: 100;
    right: 0;
    top: 0;
}
</style>